/* Autostop
 *
 * Copyright (c) Maciej Gajewski, Grzegorz Latarowski
 * http://code.google.com/p/autostop-automaty-drogowe
 *
 * This program is free software; you can redistribute it and/or modify it
 * under the terms of the GNU General Public License as published by the
 * Free Software Foundation; either version 2 of the License, or (at your
 * option) any later version. NO WARRANTY OF ANY KIND is expressed or implied.
 */

#ifndef SERVERTHREAD_H
#define SERVERTHREAD_H

// qt
#include <QThread>
#include <QTcpSocket>

// local
#include "gexception.h"
#include "adjusterserver.h"
#include "baseserver.h"
#include "constants.h"


// ------------------------- ServerThread{} ----------------------------------
// ---------------------------------------------------------------------------
class ServerThread : public QThread
{
public:
		
	enum ServerType
	{
		SERVER_ADJUSTER,
		SERVER_BASE
	};
	
	// ====================================================
	// constructor/desctructor
	
	ServerThread( const quint8 serverType, int socket, QObject * pParent );
	virtual ~ServerThread();

	
	// ====================================================
	// thread run
	
	virtual void run();

	
private:
	int	_socket;	///< socket handle
	quint8 _serverType;
	
}; // class !ServerThread
// ---------------------------------------------------------------------------




#endif // SERVERTHREAD_H


// eof

